The following APL function is printed in del-editor style:
A larger font has been selected by inserting the generated code
into a \Large
environment:
\begin{Large} % FNS MEAN \begin{APLfns} \begin{APLfnsline}{}{\APLdel} \APLZ\APLleftarrow\APLM\APLE\APLA\APLN \APLspace\APLX \end{APLfnsline} \begin{APLfnsline}{\APLleftbracket\APLone \APLrightbracket}{} ... \end{APLfns} \end{Large}
The canonical representation of an APL function is simply a text matrix. Since older APL systems only provide arrays of uniform datatype and rectangular shape, padding of short lines with spaces is performed. In contrast to the del-editor style, the canonical representation is typeset like an APL array with fixed spacing and without line numbering. For the canonical representation of a small typewriter type style was chosen:
You notice immediately that we have used the LATEX commands
\small
and \tt
to produce this effect:
{\small\tt % CR MEAN \begin{APLcr} \APLmb{\APLZ}\APLmb{\APLleftarrow} \APLmb{\APLM}\APLmb{\APLE} \APLmb{\APLA}\APLmb{\APLN} \APLmb{\APLspace}\APLmb{\APLX} \APLspace\par ... \end{APLcr} }
In addition to the del-editor representation and the canonical representation of an APL function we provide means for formatting direct definitions of functions, which are supported by only a few APL dialects, e.g. I–APL:
This direct definition of a function computing Fibonacci numbers is due to [Iverson 87] and has been formatted as follows:
\begin{APLline} \APLf\APLi\APLb\APLcolon\APLspace\APLz \APLcomma\APLplus\APLslash \APLoverbar\APLtwo\APLuparrow\APLz ... \end{APLline}
Note, that the APLline environment allows ligatures within names.